-
-
Notifications
You must be signed in to change notification settings - Fork 479
feat (form-core): Merging Form-level server errors with Field-level errors #1432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat (form-core): Merging Form-level server errors with Field-level errors #1432
Conversation
View your CI Pipeline Execution ↗ for commit bc561fc.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1432 +/- ##
==========================================
- Coverage 89.24% 88.21% -1.04%
==========================================
Files 31 31
Lines 1432 1451 +19
Branches 366 376 +10
==========================================
+ Hits 1278 1280 +2
- Misses 137 150 +13
- Partials 17 21 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Instead of the previous
serverValidate
function just returning a string, we now return an object:This then maps to the field-level errors with the
setMeta
options.The only reason this is called a preliminary approach is because we are setting the
onServer
key of the errorMap differently.Previously, the error map for the form looked like so:
Now however, the onServer map is slightly different:
This causes some degree of inconsistency, which is why I would love some feedback on whether we can use some other property (or maybe create our own!) to manage the errors between fields and forms. This would not be a comprehensive property but just a map to sync them back and forth.
NextJS support has been pushed. Remix and Start coming soon.
Support for Array field types will also be done shortly.
Would love your feedback and comments on this approach before I proceed!
Solves the following issue: #1260